package com.feixiu.controller;

import com.feixiu.pojo.Station;
import com.feixiu.service.StationService;
import com.feixiu.service.impl.StationServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;


@Controller
@RequestMapping("/test")
public class First {

    @Autowired
    private StationService stationService;
    @RequestMapping( "/first.do")
    public String doFirst(Model model){
        model.addAttribute("hello","hello,world");
        System.out.println("jsjajsjj");
        return "test";
    }
    @RequestMapping( "/dao.do")
    public String doDao(Model model){
        List<Station> list= stationService.getAllStation();
        list.forEach(item -> System.out.println(item));

        return "test";

    }

}
